<script setup lang="ts">
import { useRouter } from "vue-router";

type Prop = {
  to?: string;
  query?: any;
  param?: any;
  label?: string;
  icon?: any;
};

const router = useRouter();
const props = defineProps<Prop>();
const onClick = () => {
  router.push({
    path: props.to,
    query: props.query
  });
};
</script>

<template>
  <el-button type="primary" text :icon="icon" link @click="onClick">
    {{ label }}
  </el-button>
</template>
<style lang="scss" scoped></style>
